package cglib;

import net.sf.cglib.proxy.Enhancer;

/**
 * @author MaoLin Wang
 * @description
 * @date 2020/9/9 5:02 下午
 */
public class Test {
    public static void main(String[] args) {
        Enhancer enhancer=new Enhancer();
        enhancer.setSuperclass(Dog.class);
        enhancer.setCallback(new CgLigInterceptor());
        Dog dog= (Dog) enhancer.create();
        dog.eat();
        System.out.println(dog.getName());
    }
}
